import React, { memo, FC } from 'react';
import { FormInstance } from 'antd/lib/form';
import { AddDoorType } from '../../../../API';

import ProTable, { ProColumns } from '@/components/ProTable';

const TimeForm: FC<{
  formRef: React.MutableRefObject<FormInstance | undefined>;
}> = ({ formRef }) => {
  const columns: ProColumns<AddDoorType>[] = [
    {
      title: '日期/时间:',
      dataIndex: 'time',
      valueType: 'dateTime',
      rules: [
        {
          required: true,
        },
      ],
    },
  ];

  return (
    <>
      <ProTable<AddDoorType>
        form={{ layout: 'vertical', autoComplete: 'off' }}
        columns={columns}
        type={'form'}
        formRef={formRef}
      />
    </>
  );
};

export default memo(TimeForm);
